home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-13
/
me_cd22.zip
/
MUTT2.ZIP
/
HIDEBUF.MUT
< prev
next >
Wrap
Text File
|
1992-04-27
|
2KB
|
82 lines
;; C Durland Public Domain
(include me2.h)
(defun
prev-buffer { (nex-buffer -1) }
next-buffer { (nex-buffer 1) }
nex-buffer (int tick) HIDDEN
{
(int bid i n)
(n (nth-buffer))
(while TRUE
{
(if (<= (+= n tick) 0) (n (buffers)))
(bid (nth-buffer n))
(if (== (current-buffer) bid) (done)) ;; no previous buffer
(if (buffer-not-hidden bid)
{
(current-buffer bid TRUE)
(done)
})
})
;(current-buffer (nth-buffer -1 tick BFHidden) TRUE)
; (current-buffer
; (nth-buffer (+ tick (nth-buffer -1 BFHidden)) BFHidden)
; TRUE)
}
Nth-buffer HIDDEN
{
(int j)
(for (j 0) (< j (buffers)) (+= j 1)
(if (== (nth-buffer j) (current-buffer)) { j (done) }))
}
buffer-not-hidden (int bid) HIDDEN
{
(== 0 (bit-and (buffer-flags bid)
(bit-or BFHidden BFHidden2)))
}
MAIN
{
(bind-to-key "next-buffer" "F-2")
; (bind-to-key "prev-buffer" "~")
}
)
(defun
hide-buffer
{
(int bid)
(bid (current-buffer))
(msg "Hiding " (buffer-name bid))
(buffer-flags -1 (bit-or BFHidden2 (buffer-flags -1)))
(next-buffer)
(msg "Hid " (buffer-name bid))
}
reset-hide-bit (int bid) HIDDEN
{
(buffer-flags bid
; (bit-and (bit-not BFHidden2) (buffer-flags bid)))
(bit-and (bit-xor 0xFFFFFFFF BFHidden2) (buffer-flags bid)))
}
unhide-buffer
{
(reset-hide-bit (attached-buffer (complete CC_BUF "Unhide buffer: ")))
}
unhide-buffers ;; unhide all buffers
{
(int j)
(for (j 0) (< j (buffers)) (+= j 1) (reset-hide-bit (nth-buffer j)))
}
MAIN
{
(bind-to-key "hide-buffer" "M-h")
}
)